package com.google.code.irouter.servlet;

import java.io.IOException;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.code.irouter.batch.Dispatcher;

public final class Dispatch extends HttpServlet {

	private static final long serialVersionUID = 3404778802560185616L;

	@Override
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws IOException {
		doGet(request, response);
	}
	
	@Override
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws IOException {
		boolean continuedFlag = false;
		if(request.getParameter("continued") != null)
			if(request.getParameter("continued").equals("1"))
				continuedFlag = true;		
		if(continuedFlag)
			Dispatcher.continued();
		else
			Dispatcher.execute();
	}

}
